Skip to content

Conversation

@oneonestar
Copy link
Member

@oneonestar oneonestar commented Jan 7, 2026

Description

Fix Docker image build error.

Add retry to download JDK, copy from trinodb/trino#27485
Use native arch to download and extract JDK. This avoids running tar inside QEMU.

Additional context and related issues

Error:

#9 [jdk-download 2/2] RUN     set -xeuo pipefail &&     dnf install -y tar gzip &&     echo "Downloading JDK from https://api.adoptium.net/v3/binary/version/jdk-25.0.1+8/linux/aarch64/jdk/hotspot/normal/eclipse?project=jdk" &&     mkdir -p "/usr/lib/jvm/jdk-25.0.1+8" &&     curl -#LfS "https://api.adoptium.net/v3/binary/version/jdk-25.0.1+8/linux/aarch64/jdk/hotspot/normal/eclipse?project=jdk" | tar -zx --strip 1 -C "/usr/lib/jvm/jdk-25.0.1+8"
#9 9.281 
...
tar: lib/modules: Cannot open: Invalid argument
#9 18.63 tar: lib/libfreetype.so: Cannot open: Invalid argument
#9 18.63 tar: lib/libsleef.so: Cannot open: Invalid argument
...
--------------------
  22 |     
  23 | >>> RUN \
  24 | >>>     set -xeuo pipefail && \
  25 | >>>     dnf install -y tar gzip && \
  26 | >>>     # Install JDK from the provided archive link \
  27 | >>>     echo "Downloading JDK from ${JDK_DOWNLOAD_LINK}" && \
  28 | >>>     mkdir -p "${JAVA_HOME}" && \
  29 | >>>     curl -#LfS "${JDK_DOWNLOAD_LINK}" | tar -zx --strip 1 -C "${JAVA_HOME}"
  30 |     
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c set -xeuo pipefail &&     dnf install -y tar gzip &&     echo \"Downloading JDK from ${JDK_DOWNLOAD_LINK}\" &&     mkdir -p \"${JAVA_HOME}\" &&     curl -#LfS \"${JDK_DOWNLOAD_LINK}\" | tar -zx --strip 1 -C \"${JAVA_HOME}\"" did not complete successfully: exit code: 2
Error: Process completed with exit code 1.

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

@cla-bot cla-bot bot added the cla-signed label Jan 7, 2026
@oneonestar oneonestar changed the title Retry JDK download in Docker image build Fix docker image build error Jan 7, 2026
@oneonestar oneonestar force-pushed the ypoon/retry_jdk_download branch from 45028ea to 13f3b94 Compare January 7, 2026 07:46
ARG TRINO_GATEWAY_BUILD_IMAGE

FROM ${TRINO_GATEWAY_BUILD_IMAGE} AS jdk-download
FROM --platform=$BUILDPLATFORM ${TRINO_GATEWAY_BUILD_IMAGE} AS jdk-download
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What value do you expect for $BUILDPLATFORM value?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think GitHub Actions runner is usually x86_64.

@ebyhr ebyhr merged commit d81803f into trinodb:main Jan 7, 2026
2 checks passed
@github-actions github-actions bot added this to the 17 milestone Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants